<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE HTML PUBLIC "" "">
<f:view xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core"
	xmlns:w="http://www.apusic.com/jsf/widget" xmlns:layout="http://www.apusic.com/jsf/layout"
	xmlns:h="http://java.sun.com/jsf/html" xmlns:ajax="http://www.apusic.com/jsf/ajax"
	renderKitId="AJAX" xmlns:epm="http://www.bp.com.cn/epm" xmlns:c="http://java.sun.com/jstl/core">
	<w:head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<w:stylesheet src="/css/kmp4.css" type="text/css"></w:stylesheet>
		<w:script src="/javascript/k4.js" type="text/javascript" language="UTF-8"></w:script>
		<w:script src="/javascript/UKScript/ukJS.js" type="text/javascript" language="UTF-8"></w:script>
		<script>
		 	//<![CDATA[
		 	function closeWindow(jsvar){
			window_rd.hide();
			refreshData(jsvar);			
		}
		function refreshData(jsvar){
			//if(dep_relation)
				//dep_relation.location.reload();
			//if(role_relation)
				//role_relation.location.reload();
			if(jsvar!=null&&''!=jsvar){
				var frame=document.getElementById(jsvar+'_frame');
				var src=frame.src;
				frame.src=src;
			}
		}
		
		function refreshThisPage(){
			window.location.reload();
		}
		
		function showRelation(title,url){
			iframe_rd.location.href=url;
			window_rd.setTitle(title);
			window_rd.show();
		}
		function setUKuser(userName){
			var result = initUK(userName);
			if(result != null && result.length==32){
				setUKuserAction.addParam('pid', result);                
				setUKuserAction.submit();
			}   
		}
		function typeFormatter(v){
    	     	if(v == "uk"){
    	     		return "UK用户";
    	     	}	
    	     	return "普通用户";
    	}
		     //]]>
		 </script>
	</w:head>
	<w:page title="查看用户信息">
		<ajax:submitAction id="setUKuserAction" jsvar="setUKuserAction"></ajax:submitAction>
		<layout:borderLayout fitToBody="true">
			<layout:panel region="center" fit="true" autoScroll="true" split="true" border="false"
				styleClass="k4-combineform">
				<w:form>
					<w:toolBar id="toolbar_ope">
						<w:button value="修改用户"
							image="#{facesContext.externalContext.requestContextPath}/images/edit.gif" id="modifyAccount"
							immediate="true" />
						<w:separator id="separator" />
						<w:button value="生成员工信息"
							image="#{facesContext.externalContext.requestContextPath}/images/edit.gif"
							id="createEmployee" immediate="true" rendered="false" />
						<w:separator rendered="false" />
						<w:button value="修改用户角色"
							image="#{facesContext.externalContext.requestContextPath}/images/edit.gif"
							onclick="javascript:showRelation('用户角色','#{facesContext.externalContext.requestContextPath}/modules/system/editUserRole.faces?userId=#{system_showSecurityUserBean.securityUser.userId}')"
							immediate="true" alwaysSubmit="false" />
					</w:toolBar>
					<layout:panelGrid columns="2" cellpadding="0" cellspacing="0" border="1"
						styleClass="k4-combineform-grid">
						<layout:cell styleClass="k4-form-fieldtitle">
							<h:outputLabel value="用户姓名" />
						</layout:cell>
						<layout:cell styleClass="k4-form-fieldvalue">
							<h:outputText value="#{system_showSecurityUserBean.securityUser.fullname}">
							</h:outputText>
						</layout:cell>
						<layout:cell styleClass="k4-form-fieldtitle">
							<h:outputLabel value="登录用户名" />
						</layout:cell>
						<layout:cell styleClass="k4-form-fieldvalue">
							<h:outputText value="#{system_showSecurityUserBean.securityUser.username}">
							</h:outputText>
						</layout:cell>
						<layout:cell styleClass="k4-form-fieldtitle">
							<h:outputLabel value="用户类型" />
						</layout:cell>
						<layout:cell styleClass="k4-form-fieldvalue">
							<h:outputText value="#{system_showSecurityUserBean.loginTypeString}">
							</h:outputText>
						</layout:cell>
						<layout:cell styleClass="k4-form-fieldtitle">
							<h:outputLabel value="是否有效" />
						</layout:cell>
						<layout:cell styleClass="k4-form-fieldvalue">
							<h:outputText value="#{system_showSecurityUserBean.securityUser.enabled}"
								converter="yesNoFormatter">
							</h:outputText>
						</layout:cell>
					</layout:panelGrid>
				</w:form>
			</layout:panel>
			<layout:panel region="south" split="true" fit="true" height="200" border="false">
				<layout:tabLayout border="false" style="height: 100%;" fit="true">
					<layout:panel title="关联部门"
						url="/modules/system/departmentListOfOnePerson.faces?userId=#{system_showSecurityUserBean.securityUser.userId}"
						lazyLoad="true" jsvar="dep_relation">
					</layout:panel>
					<!--<layout:panel title="主管部门"
						url="/modules/system/listManageDepOfOnePerson.faces?userId=#{system_showSecurityUserBean.securityUser.userId}"
						lazyLoad="true" jsvar="manageDep_relation">
					</layout:panel>
					--><layout:panel title="关联角色"
						url="/modules/system/roleListOfOnePerson.faces?userId=#{system_showSecurityUserBean.securityUser.userId}"
						lazyLoad="true" jsvar="role_relation">
					</layout:panel>
				</layout:tabLayout>
			</layout:panel>
		</layout:borderLayout>
		<layout:window width="450" height="210" modal="true" collapsible="false" resizable="true"
			show="false" id="detailDialog" border="true" y="100" x="150">
			<w:iframe id="frame" style="width: 100%;height: 100%" frameborder="no" />
		</layout:window>
		<layout:window jsvar="window_rd" show="false" autoScroll="true" width="450" height="390" y="2"
			x="330">
			<w:iframe id="iframe_rd" name="iframe_rd" style="width:100%;height:99%;" frameborder="0"></w:iframe>
		</layout:window>
	</w:page>
</f:view>